package cn.kduck.code.generate.service;

import cn.kduck.code.generate.service.impl.CodeGenProgressListenerImpl.CodeGenProgress;

import java.io.OutputStream;
import java.util.List;

public interface GenerateService {

    String generate(GenerateType[] type,String moduleId,String prompt);

    void zipCodeFiles(String sourceCodeFilePath, OutputStream outputStream);

    List<CodeGenProgress> getGenerateProgress(String moduleId);

    enum GenerateType {
        ENTITY("entity_package.prompt",""),
        MODULE("base.prompt",""),
        SERVICE("service_package.prompt","service（业务接口以及业务的Bean对象），service.impl（业务接口的实现类），exception（业务自定义的异常类）"),
        WEB("web_package.prompt","web（以rest接口提供外部调用的实现类，由spring-mvc来实现）"),
        QUERY("query_package.prompt","query（框架对于查询的构造器）"),
        SCRIPT("table_script.prompt","script（存放生成的实体表建表语句）");

        private final String describe;
        private String promptName;

        GenerateType(String promptName,String describe){
            this.describe = describe;
            this.promptName = promptName;
        }

        public String getPromptName() {
            return promptName;
        }

        public String getDescribe() {
            return describe;
        }
    }
}
